﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsOperate.ascx.cs" Inherits="ltMan_news_NewsOperate" %>
<style>
.stab td { padding: 2px 5px; }
</style>
<script type="text/javascript" src="/xheditor/jquery/jquery-1.4.2.min.js?v=1.1.2"></script>
<script type="text/javascript" src="/xheditor/xheditor-zh-cn.min.js?v=1.1.2"></script>
<script type="text/javascript" src="/xheditor/editorconfig.js"></script>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        var comboBox1, tree1;
        function nodeClicking(sender, args) {
            setSelectedNode(comboBox1, args.get_node());
        }
        function setSelectedNode(comboBox, node) {
            comboBox.set_text(node.get_text());
            comboBox.set_value(node.get_value());
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text(node.get_text());
            comboBox.get_items().getItem(0).set_value(node.get_value());
            comboBox.commitChanges();
            comboBox.hideDropDown();
        }
        function setChkVisible() {
            if ($('.syncType1 :checkbox').attr('checked'))
                $('.syncType2').removeClass('hidden');
            else
                $('.syncType2').addClass('hidden');
        }
        function cboSyncClosed() {
            var s = $find('<%=comboMany.ClientID %>');
            var html = [];
            $('#<%=comboMany.ClientID %>_DropDown :checkbox:checked + label')
                .each(function () { html.push($(this).html()); });
            s.hideDropDown();
            s.set_emptyMessage(html.join(','));
        }
        Sys.Application.add_load(function () {
            configEditor($('#<%=News_content.ClientID %>'));
            comboBox1 = $find("<%=News_class.ClientID %>"), tree1 = $find('<%=News_class.Items[0].FindControl("RadTreeView1").ClientID %>');
            setSelectedNode(comboBox1, tree1.get_selectedNode() || tree1.get_nodes().getNode(0));
            setChkVisible();
            $('.syncType1 :checkbox').click(setChkVisible);
            cboSyncClosed();
            $('#<%=comboMany.ClientID %>_DropDown :button').click(cboSyncClosed);
            $('.RadDock').css('position', 'static');
        });
    </script>
</telerik:RadCodeBlock>
<%--<telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="mainPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>--%>
<telerik:RadDock ID="RadDock1" runat="server" Width="98%" EnableRoundedCorners="true"
    Top="" Left="" DefaultCommands="None" DockMode="Docked" Pinned="true">
    <ContentTemplate>
        <asp:Panel ID="mainPanel" runat="server">
            <telerikEx:InfoPanelNoValidation runat="server" ID="infoPanel" />
            <table class="stab" align="center" width="100%">
                <tr>
                    <td width="90" class="ta-center">
                        标题名称：
                    </td>
                    <td colspan="3">
                        <telerik:RadTextBox runat="server" ID="News_title" Width="95%" MaxLength="100" />
                    </td>
                </tr>
                <tr>
                    <td class="ta-center">
                        所属类别：
                    </td>
                    <td width="200">
                        <telerik:RadComboBox runat="server" ID="News_class" Width="175" Height="300">
                            <ItemTemplate>
                                <telerik:RadTreeView runat="server" ID="RadTreeView1" DataTextField="classname" DataValueField="class_id"
                                    DataFieldID="class_id" DataFieldParentID="father_id" OnClientNodeClicking="nodeClicking" />
                            </ItemTemplate>
                            <Items>
                                <telerik:RadComboBoxItem Text="" />
                            </Items>
                        </telerik:RadComboBox>
                    </td>
                    <td width="100" class="ta-center">
                        <% if (isGov)
                           { %>发布机构：<%}
                           else
                           { %>文章作者：<%} %>
                    </td>
                    <td>
                        <% if (isGov)
                           { %><telerik:RadTextBox runat="server" ID="News_jg" Width="175" MaxLength="50" />
                        <%}
                           else
                           {  %>
                        <telerik:RadTextBox runat="server" ID="News_author" Width="175" MaxLength="50" /><%} %>
                    </td>
                </tr>
                <tr>
                    <td class="ta-center">
                        <% if (isGov)
                           { %>发布文号：<%}
                           else
                           { %>文章来源：<%} %>
                    </td>
                    <td>
                        <% if (isGov)
                           { %><telerik:RadTextBox runat="server" ID="News_wh" Width="175" MaxLength="50" />
                        <%}
                           else
                           {  %>
                        <telerik:RadTextBox runat="server" Text="区志愿者协会" ID="News_Source" Width="175" MaxLength="50" /><%} %>
                    </td>
                    <td width="100" class="ta-center">
                        <% if (isGov)
                           { %>实施时间：<%}
                           else
                           { %>关 键 字：<%} %>
                    </td>
                    <td>
                        <% if (isGov)
                           { %><telerik:RadDateTimePicker runat="server" ID="News_ss_dat" DateInput-ReadOnly="true"
                               Calendar-FastNavigationSettings-OkButtonCaption="确定" Calendar-FastNavigationSettings-CancelButtonCaption="取消"
                               Calendar-FastNavigationSettings-TodayButtonCaption="今天" />
                        <%}
                           else
                           {  %>
                        <telerik:RadTextBox runat="server" ID="News_keyword" Width="175" MaxLength="100" /><%} %>
                    </td>
                </tr>
                <tr>
                    <td class="ta-center">
                        发布时间：
                    </td>
                    <td>
                        <telerik:RadDateTimePicker runat="server" ID="News_dat" DateInput-ReadOnly="true"
                            Calendar-FastNavigationSettings-OkButtonCaption="确定" Calendar-FastNavigationSettings-CancelButtonCaption="取消"
                            Calendar-FastNavigationSettings-TodayButtonCaption="今天" />
                        <%--<input type="hidden" runat="server" id="News_titlepic" class="News_titlepic" />--%>
                    </td>
                    <td width="100" class="ta-center syncType1">
                        <asp:CheckBox runat="server" ID="cbx_many" Text="同步类别" />
                    </td>
                    <td class="syncType2 hidden">
                        <telerik:RadComboBox ID="comboMany" runat="server" EmptyMessage="选择同步类别" Width="250"
                            OnClientDropDownClosed="cboSyncClosed">
                            <ItemTemplate>
                                <asp:CheckBoxList ID="cbxl_many" runat="server" RepeatColumns="2" CellSpacing="3"
                                    CellPadding="1">
                                </asp:CheckBoxList>
                                <div class="ta-center">
                                    <input type="button" value="确定" /></div>
                            </ItemTemplate>
                            <Items>
                                <telerik:RadComboBoxItem Text="" />
                            </Items>
                        </telerik:RadComboBox>
                    </td>
                </tr>
                    <tr>
                    <td width="90" class="ta-center">
                        标题图片：
                    </td>
                    <td colspan="3">
                        <input name="News_titlepic" type="text" class="News_titlepic" size="50" id="News_titlepic" maxlength="100" runat="server">
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <textarea id="News_content" name="News_content" runat="server" style="width: 100%;
                            height: 270px;"></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" class="ta-center">
                       <asp:Button ID="RadSave" runat="server" Text="保存" ToolTip="保存" CssClass="icon-text2 icon-save" OnClick="RadSave_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </ContentTemplate>
</telerik:RadDock>